#pragma once
#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
using namespace std;
class queue {
private:
	int score;
	string name;
	queue* next;
public:
	queue(int _score = 0,string _name=" ") {
		score = _score;
		name = _name;
		next = nullptr;
	}
	~queue() {}
	void push_back(int _score = 0, string _name = " ") {
		queue* tmp = this;
		while (tmp->next)tmp = tmp->next;
		tmp->next = new queue(_score,_name);
	}
	void pop() {
		int i = score;
		score = next->score;
		name = next->name;
		next = next->next;
	}
	void best_score() {
		queue* tmp = this->next;
		int max = score;
		while (tmp) {
			if (tmp->score > max)max = tmp->score;
			tmp = tmp->next;
		}
		cout << max << endl;
	}
	void print() {
		queue* tmp = this;
		while (tmp) {
			cout << tmp->name << " " << tmp->score << " ";
			tmp = tmp->next;
		}
		cout << endl;
	}
	
};
int main() {
	queue q(91,"li1");
	q.push_back(92, "li2");
	q.push_back(92, "li3");
	q.push_back(95, "li4");
	q.push_back(90, "li5");
	q.push_back(92, "li6");
	q.print();
	q.pop();
	q.print();

	q.best_score();

	return 0;
}